# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=openobex
pkgver=1.7.2
pkgrel=2
pkgdesc="Implementation of the OBject EXchange (OBEX) protocol"
url="http://dev.zuckschwerdt.org/openobex/"
arch="all"
license="GPL LGPL"
depends=
depends_dev="libusb-dev"
makedepends="$depends_dev bluez-dev cmake eudev-dev libxml2-utils docbook-xsl"
subpackages="$pkgname-dev $pkgname-doc $pkgname-apps"
source="https://downloads.sourceforge.net/project/openobex/openobex/$pkgver/openobex-$pkgver-Source.tar.gz"

_builddir="$srcdir"/openobex-$pkgver-Source

build() {
	cd "$_builddir"
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=/usr/lib \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_SKIP_RPATH=ON \
		|| return 1
	make && make openobex-apps || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
}

apps() {
	pkgdesc="Applications for using OBEX"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="22f1b0d99e7186da9fa12b510ef9dbb6f7d76777d58b235ab2f627703d07b6f6b0488cdc9c6d8c0ab7bc86d6d19117c55fff9273fed02736c0210f9b1788bf4d  openobex-1.7.2-Source.tar.gz"
